package com.ajie.mapper;

import com.ajie.entity.SysPermission;
import com.ajie.entity.SysUser;
import com.ajie.entity.dto.Option;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author: ajie
 * @createTime: 2024-06-22 18:08
 */
@Mapper
public interface SysUserMapper extends BaseMapper<SysUser> {
    List<Option> getRolesByUserId(@Param("userId") String userId);

    void insertRoleIds(@Param("userId") String userId, @Param("roleIds") List<Object> roleIds);

    void deleteRoleByUserId(@Param("userId") String userId);

    List<String> getRoleCodeByUserId(@Param("userId") String userId);

    List<String> listPermissionByRoleCode(@Param("roleCode") String roleCode);

    List<SysPermission> listParentMenuByUserId(@Param("userId") String userId);

    List<SysPermission> listMenuByUserId(@Param("userId") String userId, @Param("parentId") String parentId);
}
